/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       multitexturedmaterial.vert
 * Author:     karooolek
 * Created on: 2009-06-23
 *
 **********************************************************************************************************************/

STRINGIZE(

varying vec4 position;
varying mat3 tbn;

void main()
{
    // pass texture coordinates
    gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;

    // pass vertex position
    position = gl_ModelViewMatrix * gl_Vertex;
    
    // pass tangent, binormal, normal
    vec3 tangent = vec3(gl_SecondaryColor);
    tbn = gl_NormalMatrix * mat3(tangent, cross(gl_Normal, tangent), gl_Normal);
    
    // transform vertex
    gl_Position = ftransform();    
}

) // STRINGIZE
